
import lejos.nxt.LCD;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Nicolas
 */
public class Case {

    private int x;
    private int y;
    private TypeCase TYPE_CASE;

    public Case(int x, int y){
        this.x = x;
        this.y = y;
    }
    
    public Case(int x, int y, TypeCase TYPE_CASE){
        this.x = x;
        this.y = y;
        this.TYPE_CASE=TYPE_CASE;
    }

    public int getX(){
        return x;
    }

    public void setX(int x){
        this.x=x;
    }
    
    public int getY(){
        return y;
    }  
    
    public void setY(int y){
        this.y=y;
    }
    
    public void setTypeCase(TypeCase TYPE_CASE){
        this.TYPE_CASE=TYPE_CASE;
    }
    
    public TypeCase getTypeCase(){
        return this.TYPE_CASE;
    }
    
    public void translate(Direction direction){
        this.x+=direction.dx();
        this.y+=direction.dy();
    }
    
    public boolean estFranchissable(){
        return this.TYPE_CASE.estFranchissable();
    }
    
    public void draw(int x, int y){
        LCD.drawChar(this.TYPE_CASE.toDraw(), x*9, y*9, true);
    }
        
    public boolean equals(Case a_case){
        return this.x==a_case.getX() && this.y==a_case.getY();

    }
}
